<template>
  <div class="app-container">
    <el-table :data="tableList">
      <el-table-column
        label="内容"
        prop="content"
      ></el-table-column>
    </el-table>
    <div class="pageMain">
      <el-pagination
        background
        :current-page.sync="pn"
        :page-size.sync="ps"
        :page-sizes="[10, 20, 50, 100, 200, 500, 1000]"
        :pager-count="5"
        :hide-on-single-page="true"
        layout="total, sizes, prev, pager, next, jumper"
        :total="count"
        @size-change="getList"
        @current-change="getList"
      >
      </el-pagination>
    </div>
  </div>
</template>

<script>
// import { fetchList, fetchPv, createArticle, updateArticle } from '@/api/article'
import waves from '@/directive/waves'

export default {
  name: 'ComplexTable',
  components: { },
  directives: { waves },
  filters: {
  },
  data() {
    return {
      tableList: [],
      ps: 20,
      pn: 1,
      count: 0
    }
  },
  created() {
    this.getList()
  },
  methods: {
    async getList(params) {
      params = {
        ps: this.ps,
        pn: this.pn,
        ...params
      }
      const { data, count } = await this.$store.dispatch('sentence/getSentence', params)
      this.tableList = data || []
      this.count = count || 0
    }
  }
}
</script>
<style lang="scss" scoped>
  .pageMain {
    text-align: center
  }
</style>
